Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for test certificate download and handling #50

Merged
merged 3 commits into from
May 7, 2023
Merged

Conversation

1sfb
Copy link
Contributor

@1sfb 1sfb commented May 6, 2023

I've had some initial problems getting the test setup running due to triggering the CAPTCHA testing on the BankID end causing
the FPTestcert4_20220818.p12 downloaded by create_bankid_test_server_cert_and_key to contain the CAPTCHA test
instead.

This caused the openssl execution in split_certificate to silently fail, resulting in zero length certificate and key.

Added a bit of error handling to detect and raise an exception in split_certficate for subprocess errors, also added the
possibility to point the environment variable TEST_CERT_FILE to an existing p12 certificate file which will be used instead
of fetching the certificate (which got me out of the snag by letting me download the file from my browser instead).

@hbldh hbldh changed the base branch from master to develop May 7, 2023 13:02
@hbldh hbldh self-assigned this May 7, 2023
@hbldh hbldh merged commit 636ac44 into hbldh:develop May 7, 2023
@hbldh
Copy link
Owner

hbldh commented May 7, 2023

Thank you!

@hbldh hbldh mentioned this pull request May 7, 2023
hbldh added a commit that referenced this pull request May 7, 2023
- Merge of Update README.rst #41
- Merge of Update __init__.py #48
- Merge of Fixes for test certificate download and handling #50

Now bundles the Test certificate with the actual code so that test will work due to

- Captcha prevents fetching of cert as before
- openssh seems to fail to break p12 into pem files, so pem file were included as well.

`certutils` needs to be examined in the near future.


* Update README.rst

Corrected typo in examples

* Update __init__.py

Fix breakage with urllib 2.0.x

* Github Action fixes

* Version bump

* Bump reqs for example

* Bundle the BankID Test certificate

The BankID pages now returns a captcha instead of the actual certificate when fetching with requests. The actual cert is now bundled instead of fetched each time.

* Failure detection in openssl test cert conversion

* Add possibility to provide p12 test cert through existing file

* Bundle the BankID Test certificate in pem format

Bundle pem formats as well.

* Python 2.7 compat. fix

* Rmoving certutils test for the time being

* Remove Python 2.7 support

* Remove six dependency

---------

Co-authored-by: Simon Olofsson <[email protected]>
Co-authored-by: Colin 't Hart <[email protected]>
Co-authored-by: Stefan Berg <[email protected]>
@hbldh
Copy link
Owner

hbldh commented May 7, 2023

@1sfb This is now released to PyPI in version 0.14.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants